package com.teacherprofile.manage.domain.vo;


import lombok.Data;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.MessageType;

@Data
public class MessageVO {
    public MessageVO() {
    }

    private String chatId;
    private String role;
    private String content;
    public MessageVO(Message message) {
        MessageType messageType = message.getMessageType();
        switch (messageType) {
            case USER:
                this.role = "user";
                break;
            case ASSISTANT:
                this.role = "assistant";
                break;
            default:
                this.role = "";
                break;
        }
        this.content = message.getText();
    }

}
